<template>
  <div>
    <div class="dialog-wrap" v-if="isShow">
      <div class="dialog-cover" @click="closeMyself"></div>
      <transition name="drop">
        <div class="dialog-content" v-if="isShow">
          <slot></slot>
          <div class="share-footer">
            <a @click="closeMyself" class="">取消</a>
          </div>
        </div>
      </transition>
    </div>
  </div>
</template>

<script>
export default {
  name: 'eject',
  props: {
    isShow: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    closeMyself () {
      this.$emit('on-close')
    }
  }
}
</script>

<style scoped>
  .dialog-wrap {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 99;
  }

  .dialog-cover {
    background: #000;
    opacity: .3;
    position: fixed;
    z-index: 5;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .dialog-content {
    width: 100%;
    position: fixed;
    max-height: 50%;
    overflow: auto;
    background: #fff;
    z-index: 10;
    padding: 2%;
    line-height: 1.6;
    bottom: 0;
  }

  .dialog-close {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 20px;
    height: 20px;
    text-align: center;
    cursor: pointer;
  }

  .dialog-close:hover {
    color: #4fc08d;
  }

  .share-footer {
    width: 100%;
    background-color: #fff;
    text-align: center;
    padding-top: 2%;
    font-size: 16px;
    color: #333;
  }

  .share-footer > a {
    color: #333;
    display: block;
  }
</style>
